import {useStorage} from "../../hooks/useStorage.ts";


const UseStoragePage = () => {

  const [number, setNumber] = useStorage('ks-number', 3);

  const handleChangeNumber = (step) => {
    setNumber(number + step);
  }
  return (
    <>
      <h2>UseStoragePage</h2>
      <div>
        number：{number}
      </div>
      <button onClick={() => handleChangeNumber(1)}>+1</button>
      <button onClick={() => handleChangeNumber(-1)}>-1</button>
      <hr/>
    </>
  )
}

export default UseStoragePage
